package com.whosly.trino.client;

import java.io.Serializable;

/**
 * @author 风杨
 *
 * @author fengyang(yueny09 @ 163.com)
 * @date 2022年05月23日 下午1:54
 */
public class Tuple<Left, Right> implements Serializable {

    private static final long serialVersionUID = 1;
    public Left left;

    public Right right;

    public Tuple(Left left, Right right) {
        this.left = left;
        this.right = right;
    }

    public Tuple() {
    }

    public int hashCode() {
        return left.hashCode() ^ right.hashCode();
    }

    public boolean equals(Object other) {
        if (other instanceof Tuple) {
            Tuple to = (Tuple) other;
            return (left.equals(to.left) && right.equals(to.right));
        } else {
            return false;
        }
    }

    public String toString() {
        return "[left=" + left + ", right=" + right + "]";
    }
}

